package adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2018/5/14.
 */

public class TestAdapter extends FragmentPagerAdapter {
    private String[] title ;
    List<Fragment> list;

    public TestAdapter(FragmentManager fm, String[] titles, List<Fragment> list) {
        super(fm);
        title = titles;
        this.list = list;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return title.length;
    }
}
